Skip to content

feat(plan): Plan page version cards + create modal - #61

Merged
silver-snoopy merged 1 commit into
masterfrom
feature/plan-page-version-cards
Apr 12, 2026
Merged

feat(plan): Plan page version cards + create modal#61
silver-snoopy merged 1 commit into
masterfrom
feature/plan-page-version-cards

Conversation

@silver-snoopy

Copy link
Copy Markdown
Owner

Summary

  • Redesigned Plan page with expandable version cards (matching Reports page pattern)
  • Active version highlighted with green ring indicator and "Active" badge
  • Previous versions shown as collapsed cards — click to expand and see full day/exercise breakdown
  • Plan creation moved to a modal Dialog triggered by "New Plan" button in page header
  • Added usePlanVersions hook to fetch all versions from GET /api/workout-plans/:id/versions
  • Fixed cache invalidation: useCreatePlan and useDecideAdjustments now invalidate version queries
  • Deleted PlanVersionHistory component (replaced by PlanVersionCard)

Changes

File Action
PlanPage.tsx Rewritten — version card list + create modal
PlanVersionCard.tsx New — collapsible version card with active indicator
PlanVersionHistory.tsx Deleted — replaced by PlanVersionCard
useWorkoutPlan.ts Added usePlanVersions hook + version invalidation
plan-versions.json New E2E fixture
PlanPage.ts (E2E POM) Updated selectors for new layout
workout-plan-tuner.spec.ts 3 new tests + updated existing tests
product-capabilities.md Updated UC-PLAN-01 and UC-PLAN-02

Test plan

  • npm run build — shared + frontend pass
  • npm run lint — 0 errors (2 pre-existing warnings)
  • npm run format:check — clean
  • npm test — 484 unit tests pass (410 backend + 74 frontend)
  • E2E: 10/10 plan tests pass (npx playwright test e2e/workout-plan-tuner.spec.ts)
  • Visual: empty state, create modal, version cards verified in browser

🤖 Generated with Claude Code

Replace inline plan editor and collapsible version history with a
card-based layout matching the Reports page pattern:

- Active version shown as expanded card with green ring indicator
  and "Active" badge (CheckCircle2 icon)
- Previous versions as collapsed cards (click to expand and view
  day/exercise breakdown via PlanDayCard)
- Plan creation moved to a modal Dialog triggered by "New Plan"
  button in the page header
- New usePlanVersions hook fetches all versions from the API
- Version query invalidation added to useCreatePlan and
  useDecideAdjustments for cache consistency
- Empty state with centered CTA matching other pages
- PlanVersionHistory component removed (replaced by PlanVersionCard)
- 3 new E2E tests for version display, active indicator, and
  expand/collapse
- Product capabilities doc updated for UC-PLAN-01 and UC-PLAN-02

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Apr 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
vitals Ignored Ignored Apr 12, 2026 7:34am

@silver-snoopy
silver-snoopy merged commit 44c4a37 into master Apr 12, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant